import { get, postJson } from "@/utils/http.request"
import urlFunc from "@/utils/url.func"
import {
	addExhibitionPicParams,
	getExhibitionPicListParams,
	updateExhibitionPicParams,
	deleteExhibitionPicParams,
	addExhibitionNewsParams,
	getExhibitionNewsListParams,
	updateExhibitionNewsParams,
	deleteExhibitionNewsParams,
	addFlowpathParams,
	getFlowpathListParams,
	updataFlowpathParams,
	deleteFlowpathParams,
	addExhibitionBannerParams,
	getExhibitionBannerListParams,
	updateExhibitionBannerParams,
	deleteExhibitionBannerParams,
	addPartnerParams,
	getPartnerListParams,
	updataPartnerParams,
	deletePartnerParams,
	addHighlightParams,
	getHighlightListParams,
	updataHighlightParams,
	deleteHighlightParams,
	addLiveStreamParams,
	getLiveStreamListParams,
	updataLiveStreamParams,
	getSiteMapListParams,
	updataSiteMapParams,
	updateSiteMapListParams,
	getExhibitioninfoParams,
	updateExhibitioninfoParams,
	getExhibitionMenusParams
} from "@/interfaces/params.interface"
import {
	baseRes,
	PageData,
	ExhibitionPicListItem,
	ExhibitionNewsListItem,
	LiveStreamListItem,
	ExhibitioninfoItem,
	ExhibitionMenusItem,
	HighlightListItem,
	PartnerListItem,
	ExhibitionBannerListItem,
	FlowpathListItem,
	SiteMapListItem
} from "@/interfaces/api.interface"
export default {
	//-----------展会管理相关接口-------------------

	//---展会图片部分
	addExhibitionPic(params: addExhibitionPicParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/image/create`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},

	getExhibitionPicList(params: getExhibitionPicListParams) {
		return get<baseRes<PageData<ExhibitionPicListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/image/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updateExhibitionPic(params: updateExhibitionPicParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/image/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	deleteExhibitionPic(params: deleteExhibitionPicParams) {
		console.log(params)
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/image/delete`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},

	//---展会新闻部分
	addExhibitionNews(params: addExhibitionNewsParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/news/create`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	getExhibitionNewsList(params: getExhibitionNewsListParams) {
		return get<baseRes<PageData<ExhibitionNewsListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/news/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updateExhibitionNews(params: updateExhibitionNewsParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/news/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	deleteExhibitionNews(params: deleteExhibitionNewsParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/news/delete`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},

	//---展会流程部分
	addFlowpath(params: addFlowpathParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/process/create`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	getFlowpathList(params: getFlowpathListParams) {
		return get<baseRes<PageData<FlowpathListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/process/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updataFlowpath(params: updataFlowpathParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/process/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	deleteFlowpath(params: deleteFlowpathParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/process/delete`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},

	//展会banner设置部分
	addExhibitionBanner(params: addExhibitionBannerParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/banner/create`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	getExhibitionBannerList(params: getExhibitionBannerListParams) {
		return get<baseRes<PageData<ExhibitionBannerListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/banner/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updateExhibitionBanner(params: updateExhibitionBannerParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/banner/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	deleteExhibitionBanner(params: deleteExhibitionBannerParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/banner/delete`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	//展会合作媒体部分
	addPartner(params: addPartnerParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/media/create`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	getPartnerList(params: getPartnerListParams) {
		return get<baseRes<PageData<PartnerListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/media/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updataPartner(params: updataPartnerParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/media/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	deletePartner(params: deletePartnerParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/media/delete`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},

	//展会精彩片段部分
	addHighlight(params: addHighlightParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/video/create`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	getHighlightList(params: getHighlightListParams) {
		return get<baseRes<PageData<HighlightListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/video/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updataHighlight(params: updataHighlightParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/video/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	deleteHighlight(params: deleteHighlightParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/video/delete`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	//展会直播
	addLiveStream(params: addLiveStreamParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/live/create`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	getLiveStreamList(params: getLiveStreamListParams) {
		return get<baseRes<PageData<LiveStreamListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/live/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updataLiveStream(params: updataLiveStreamParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/live/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	//3D导览岛设置

	getSiteMapList(params: getSiteMapListParams) {
		return get<baseRes<PageData<SiteMapListItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/industry/list`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updataSiteMap(params: updataSiteMapParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/industry/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},

	updateSiteMapList(params: updateSiteMapListParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/industry/updateList`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	//展会信息部分
	getExhibitioninfo(params: getExhibitioninfoParams) {
		return get<baseRes<PageData<ExhibitioninfoItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/info`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	updateExhibitioninfo(params: updateExhibitioninfoParams) {
		return postJson<baseRes>({
			url: `${urlFunc.requestHost()}/exhibition/update`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	},
	//根据展会id获取menu
	getExhibitionMenus(params: getExhibitionMenusParams) {
		return get<baseRes<PageData<ExhibitionMenusItem>>>({
			url: `${urlFunc.requestHost()}/exhibition/menubar/listMenubar`,
			params,
			headers: {
				exhibitionId: params.exhibitionId
			}
		})
	}
}
